package com.lzx.actionform;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts.action.ActionForm;
import org.apache.struts.upload.FormFile;

public class NewsForm extends ActionForm {
	private static final long serialVersionUID = 1L;

	private String id;

	private String title;

	private String subTitle;

	private String content;

	private String modelId;

	private List myFiles;

	public List getMyFiles() {
		return myFiles;
	}

	public void setMyFiles(List myFiles) {
		this.myFiles = myFiles;
	}

	public NewsForm() {
		myFiles = new ArrayList();
	}

	// 注意这个方法的定义 不加中间的循环是会出错的

	public UploadFile getUploadFile(int index) {
		int size = myFiles.size();
		if (index > size - 1) {
			for (int i = 0; i < index - size + 1; i++) {
				myFiles.add(new UploadFile());
			}
		}
		return (UploadFile) myFiles.get(index);
	}

	public String getModelId() {
		return modelId;
	}

	public void setModelId(String modelId) {
		this.modelId = modelId;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSubTitle() {
		return subTitle;
	}

	public void setSubTitle(String subTitle) {
		this.subTitle = subTitle;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

}